Developer Documentation

QuickTime 4 API Documentation

QuickTime Streaming

| Previous | Chapter Contents | Chapter Top | Next |

Initialization

Your reassembler must implement the RTPRssmInitialize function. When initialized, your reassembler is passed an RTPRssmInitParams struct containing three initialization parameters:

struct RTPRssmInitParams {
    UInt32      reserved;
    UInt8       payloadType;
    UInt8       pad[3];
    TimeBase    timeBase;
    TimeScale   controlTimeScale;
};
typedef struct RTPRssmInitParamsRTPRssmInitParams;


payloadType
1 byte identifier for the payload type. Same number as sent in the RTP header. Useful if your rssm handles more tha one format.
timeBase
The timebase for the presentation
controlTimescale
The timescale used for actions such as start, stop, etc. This is independent of the timscale used for the media. For example, the control timescale could be 600 while the media timescale could be 90000

During initialization, your reassembler should open a stream handler of the appropriate type. For example, if your reassembler works with H.261 packets, it should open a video stream handler. Stream handler types are specified in the same manner as track types (Video is videoMediaType, and so on). There are currently stream handlers for audio, video, text, and MIDI.

Your reassembler opens a stream handler by calling RTPRssmNewStreamHandler . You must specify the stream handler type when you open it. If your reassembler handles multiple media types, it can open a stream handler later, after it learns what kind of media is in the stream.

You should initialize the sample description of the stream handler when you open it, if possible. It can be set or changed later if necessary. The stream handler will be unable to process any data until its sample description is set.

Your reassembler should also initialize the timescale of the stream handler at this time. If your reassembler needs to get the timescale from the stream, it can monitor incoming packets and set the timescale when it is known. (No chunks will be sent to the stream handler until its timescale is set).

During initialization, your reassembler should call RTPRssmSetCapabilities with any initial flags to control the base reassembler's default behaviors, such as kRTPRssmEverySampleAChunkFlag or kRTPRssmTrackLostPacketsFlag .

You should also call SetPayloadHeaderLength at this time if you know the payload header length for your packets.

A typical reassembler initialization function might look like this:

EXTERN_API( ComponentResult )
RTPRssmOVAL_Initialize(
RTPHOVALGlobalsPtrinGlobals,
RTPRssmInitParams *inInitParams )
{
#pragma unused(inInitParams)
ComponentResulterr = noErr;
ImageDescriptionHandleimageDesc;
SInt32              flags = 0;

inGlobals->fTimeScale = kOVALRTPTimeScale;

flags = kRTPRssmQueueAndUseMarkerBitFlag + kRTPRssmTrackLostPacketsFlag;
err = RTPRssmSetCapabilities(inGlobals->delegateComponent, flags, -1L );
if (err == noErr) {
    imageDesc = __GetMyImageDesc( inGlobals );
    
    if( imageDesc )
    {
        err = RTPRssmNewStreamHandler(inGlobals->delegateComponent,
        VideoMediaType, ( SampleDescriptionHandle ) imageDesc,
        inGlobals->fTimeScale, NULL);
    }
    
    else
        err = memFullErr;
}
return err;
}



© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |